//
//  EvaluationedCell.m
//  QoilPublic
//
//  Created by SunChao on 17/10/9.
//  Copyright © 2017年 杨凯. All rights reserved.
//

#import "EvaluationedCell.h"

@implementation EvaluationedCell

- (void)awakeFromNib {
    [super awakeFromNib];
    UIImageView *backImageView=[[UIImageView alloc]initWithFrame:self.bounds];
    
    //设置圆角
    backImageView.layer.cornerRadius = 8;
    backImageView.layer.masksToBounds = YES;
    
    //自适应图片宽高比例
    //    backImageView.contentMode = UIViewContentModeScaleAspectFit;
    self.backgroundView=backImageView;
    
    //name为传入的要拉伸图片的图片名
    UIImage *image = [UIImage imageNamed:@"evaluationed.png"];
    
    //stretchableImageWithLeftCapWidth: topCapHeight:
    //这个方法的两个参数分别是左边不拉伸的区域和上面不拉伸的区域，相当于把图片中点1*1的像素进行拉伸
    UIImage *newImg = [image stretchableImageWithLeftCapWidth:image.size.width * 0.5 topCapHeight:image.size.height * 0.5];
    [backImageView setImage:newImg];
    
}

- (void)setFrame:(CGRect)frame{
    frame.origin.x += 10;
    frame.origin.y += 10;
    frame.size.height -= 10;
    frame.size.width -= 20;
    [super setFrame:frame];
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}
@end
